﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eShop.DataAccess.Converter
{
    public class CountryConverter
    {
        public static List<Model.MetaData.Country> ConvertToModelObject(List<Entity.Country> entities)
        {
            List<Model.MetaData.Country> models = new List<Model.MetaData.Country>(entities.Count);
            foreach (Entity.Country entity in entities)
            {
                models.Add(ConvertToModelObject(entity));
            }
            return models;
        }

        public static Model.MetaData.Country ConvertToModelObject(Entity.Country entity)
        {
            if (entity == null) return null;
            Model.MetaData.Country model = new Model.MetaData.Country();
            model.Id = entity.Id;
            model.Name = entity.Name;
            model.IsoCode = entity.IsoCode;
            return model;
        }
    }
}
